package cn.com.hhrcw.service.impl;

import cn.com.hhrcw.entity.CvProjectInfo;
import cn.com.hhrcw.mapper.CvProjectInfoMapper;
import cn.com.hhrcw.service.ICvProjectInfoService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;

/**
 * <p>
    * 简历-项目经历 服务实现类
    * </p>
 *
 * @author jiangdong
 * @since 2020-10-29
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class CvProjectInfoServiceImpl extends ServiceImpl<CvProjectInfoMapper, CvProjectInfo> implements ICvProjectInfoService {
    @Override
    public List<CvProjectInfo> getByDate(Date beginDate, Date endDate){
        LambdaQueryWrapper<CvProjectInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.between(CvProjectInfo::getCreateTime,beginDate,endDate).or().between(CvProjectInfo::getUpdateTime,beginDate,endDate);
        return this.baseMapper.selectList(lambdaQueryWrapper);
    }
}
